package com.zy.design.state.common;

/**
 * @author zhaoyi
 * @date 2021/9/23 11:59
 */
public class SmallMario implements IMario {

    private SmallMario() {
    }

    private static final SmallMario instance = new SmallMario();

    public static SmallMario getInstance() {
        return instance;
    }


    @Override
    public void eatMustRoom(MStateMachine machine) {
        machine.setMario(SuperMario.getInstance());
        machine.setScore(100);
    }

    @Override
    public void eatCape(MStateMachine machine) {
        machine.setMario(CapeMario.getInstance());
        machine.setScore(machine.getScore()+200);
    }

    @Override
    public void eatFire(MStateMachine machine) {
        machine.setMario(FireMario.getInstance());
        machine.setScore(machine.getScore()+300);
    }

    @Override
    public void monster(MStateMachine machine) {
        System.out.println("什么也不做");

    }


    @Override
    public String getStatus() {
        return "小玛丽奥";
    }
}
